/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2024-04-11
 * Time: 22:28
 */
public class copyRandomList {
   /* public Node copyRandomList(Node head) {
        Map<Node,Node> map = new HashMap<>();
        //1.第一次遍历原链表
        Node cur1 = head;
        while(cur1 != null) {
            //创建的新结点
            Node node = new Node(cur1.val);
            map.put(cur1,node);
            cur1 = cur1.next;
        }
        //2.第二次遍历原链表
        Node cur2 = head;
        while(cur2 != null) {
            map.get(cur2).next = map.get(cur2.next);
            map.get(cur2).random = map.get(cur2.random);
            cur2 = cur2.next;
        }
        return map.get(head);
    }*/
}
